package com.gegong.imr.client.vbox.cmd;

import com.gegong.imr.client.vbox.cmd.IVBoxCmd;
import lombok.Data;
import lombok.NonNull;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.virtualbox_5_2.IVirtualBox;
import org.virtualbox_5_2.VirtualBoxManager;


@Data
@RequiredArgsConstructor
@Slf4j
abstract class AbstractVBoxCmd implements IVBoxCmd {

    @NonNull
    private VirtualBoxManager virtualBoxManager;

    @NonNull
    private String targetVm;

    protected Progress progress = new Progress();

    @Override
    public Progress execute(Object... params) {
        log.info("正在执行任务-{}...", getName());
        return progress;
    }


    public IVirtualBox getVirtualBox() {
        return virtualBoxManager.getVBox();
    }
}
